export class RoleEnum {
    code: number;
    msg: string;


    constructor(code: number, msg: string) {
        this.code = code;
        this.msg = msg;
    }

    public static readonly ADMIN = new RoleEnum(1, "管理员");
    public static readonly SYS_MANAGER = new RoleEnum(2, "系统人员");
    public static readonly STORE_MANAGER = new RoleEnum(3, "店长");
    public static readonly STORE_ASSISTANT = new RoleEnum(4, "店员");

    public static format(code: number): string {
        switch (code) {
            case 1:
                return this.ADMIN.msg;
            case 2:
                return this.SYS_MANAGER.msg;
            case 3:
                return this.STORE_MANAGER.msg;
            case 4:
                return this.STORE_ASSISTANT.msg;
            default:
                return "";
        }
    }
}

